import Request from "./Request"
const Imsi={
    List:[],
    async init(){
        if(this.List.length>0){
            return;
        }
        let res = await Request.post("exclude", "GetImsi");
        let countyObj = {};
        if(res.code==0){
            res.data.forEach(ele => {
                if(!countyObj.hasOwnProperty(ele.MCC)){
                    countyObj[ele.MCC] = {"id":ele.MCC,"name":ele.CountryName,list:[{"id":ele.MCC,"name":ele.CountryName+"-全选"}]};
                }
                countyObj[ele.MCC].list.push({"id":ele.MCC+ele.MNC,"name":countyObj[ele.MCC].name+"-"+ele.Network});
            });
            for(var k in countyObj){
                this.List.push(countyObj[k])
            }
        }
    },
}
export default Imsi;